package com.rt.code.utils.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MyBaseMapper<T> extends BaseMapper<T> {


    IPage<T> myPage(Page<T> page, @Param(Constants.WRAPPER) Wrapper<T> wrapper);


    T mySelectById(long id);

    List<T> mySelectAll(@Param(Constants.WRAPPER) Wrapper<T> wrapper);

    /**
     * 查询符合条件的总记录数
     */
    int mySelectListCount(@Param(Constants.WRAPPER) Wrapper<T> wrapper);


    /**
     * 查询合计数据(select '合计',sum(balance) as balance from table )
     */
    T mySelectSum(@Param(Constants.WRAPPER) Wrapper<T> wrapper);

    long myDeleteById(T t);

    long myInsert(T t);

    long myUpdateById(T t);


}
